#ifndef __CINT__
#include <TSystem.h>
#endif
void ShowEvent()
{
  
  gSystem->Load("libCPBase.so");
  gSystem->Load("libCPPhysics.so");
  gSystem->Load("libCPSim.so");
  
  TGeoManager::Import("CpGeom.root");
  TString fname="CpSim.root";
    
    TEveManager::Create();
    
    TGeoNode* node = gGeoManager->GetTopNode();
    TEveGeoTopNode* en = new TEveGeoTopNode(gGeoManager, node);
    en->SetVisLevel(4);
    en->SetVisOption(0);
    en->GetNode()->GetVolume()->SetVisibility(kFALSE);
    
    gEve->AddGlobalElement(en);
    
    
    TEveCompound* cmp = new TEveCompound();
    cmp->SetMainColor(kGreen);
    gEve->AddElement(cmp);
    cmp->OpenCompound();
    
    
    //    Double_t initPiont[] = {0.0,0.0,0.0};
    //    Double_t initDirection[] = {0.0,0.0,1.0};
    //    gGeoManager->InitTrack(initPiont,initDirection);
    
    TFile *f = TFile::Open(fname.Data(), "READ");
    TTree *tree = (TTree*) f->Get("cpSimTree");
    CpParticle *part = 0;
    //   tree->Print();
    tree->SetBranchAddress("cpParticles", &part);
    
    CpTrack *track;
    for(Long64_t iEvent=0;iEvent<tree->GetEntries();iEvent++) {
      tree->GetEntry(iEvent);
//       part->Print();
      for ( Long64_t iParticle=0; iParticle<part->GetNumberOfTracks();iParticle++ ) {
        track = (CpTrack*) part->GetTrack(iParticle);
        TEveLine *line = new TEveLine;
        line->SetMainColor(iParticle);
        for (Long64_t iPoint=0; iPoint<track->GetNumberOfPoints();iPoint++){
          CpPoint *p = (CpPoint*) track->GetPoint(iPoint);
          p->Print();
          line->SetNextPoint(p->GetX(),p->GetY(),p->GetZ());
        }
        cmp->AddElement(line);
      }
    }
    
    cmp->CloseCompound();
    
    gEve->Redraw3D(kTRUE);
}